#pragma once
#include <iterator>
#include <stdio.h>
#include "TextWindow.h"
                                                                    
using namespace std;
class TextWindowIterator : public iterator<input_iterator_tag, TextWindow>
{
protected:
	FILE* file;
	TextWindow *buf;


public:
	int win_length;
	bool eof;

	TextWindowIterator(FILE *file, int win_length);
	~TextWindowIterator(void);

	bool operator==(const TextWindowIterator& other);
	bool operator!=(const TextWindowIterator& other);
	TextWindow &operator*();
	TextWindowIterator &operator++();

	static TextWindowIterator end();

private:
	int readChars(int n);
};

